/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbreqmonto")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbreqmonto.findAll", query = "SELECT p FROM Pyfntbreqmonto p"),
    @NamedQuery(name = "Pyfntbreqmonto.findByPyfntbreqmontoid", query = "SELECT p FROM Pyfntbreqmonto p WHERE p.pyfntbreqmontoid = :pyfntbreqmontoid"),
    @NamedQuery(name = "Pyfntbreqmonto.findByValormes", query = "SELECT p FROM Pyfntbreqmonto p WHERE p.valormes = :valormes"),
    @NamedQuery(name = "Pyfntbreqmonto.findByFecharegistro", query = "SELECT p FROM Pyfntbreqmonto p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyfntbreqmonto.findByObservaciones", query = "SELECT p FROM Pyfntbreqmonto p WHERE p.observaciones = :observaciones")})
public class Pyfntbreqmonto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbreqmontoid")
    private Integer pyfntbreqmontoid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valormes")
    private double valormes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "pyfntbrequerid", referencedColumnName = "pyfntbrequerid")
    @ManyToOne(optional = false)
    private Pyfntbrequer pyfntbrequerid;
    @JoinColumn(name = "pyfntbmesesid", referencedColumnName = "pyfntbmesesid")
    @ManyToOne(optional = false)
    private Pyfntbmeses pyfntbmesesid;

    public Pyfntbreqmonto() {
    }

    public Pyfntbreqmonto(Integer pyfntbreqmontoid) {
        this.pyfntbreqmontoid = pyfntbreqmontoid;
    }

    public Pyfntbreqmonto(Integer pyfntbreqmontoid, double valormes, Date fecharegistro, String observaciones) {
        this.pyfntbreqmontoid = pyfntbreqmontoid;
        this.valormes = valormes;
        this.fecharegistro = fecharegistro;
        this.observaciones = observaciones;
    }

    public Integer getPyfntbreqmontoid() {
        return pyfntbreqmontoid;
    }

    public void setPyfntbreqmontoid(Integer pyfntbreqmontoid) {
        this.pyfntbreqmontoid = pyfntbreqmontoid;
    }

    public double getValormes() {
        return valormes;
    }

    public void setValormes(double valormes) {
        this.valormes = valormes;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Pyfntbrequer getPyfntbrequerid() {
        return pyfntbrequerid;
    }

    public void setPyfntbrequerid(Pyfntbrequer pyfntbrequerid) {
        this.pyfntbrequerid = pyfntbrequerid;
    }

    public Pyfntbmeses getPyfntbmesesid() {
        return pyfntbmesesid;
    }

    public void setPyfntbmesesid(Pyfntbmeses pyfntbmesesid) {
        this.pyfntbmesesid = pyfntbmesesid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbreqmontoid != null ? pyfntbreqmontoid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbreqmonto)) {
            return false;
        }
        Pyfntbreqmonto other = (Pyfntbreqmonto) object;
        if ((this.pyfntbreqmontoid == null && other.pyfntbreqmontoid != null) || (this.pyfntbreqmontoid != null && !this.pyfntbreqmontoid.equals(other.pyfntbreqmontoid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbreqmonto[ pyfntbreqmontoid=" + pyfntbreqmontoid + " ]";
    }
    
}
